package c.e.b.h.e.k;

import android.content.SharedPreferences;
import c.e.a.b.g.a0;
import c.e.a.b.g.g;
import c.e.a.b.g.h;
import c.e.b.c;
import c.e.b.h.e.b;
import java.io.FilenameFilter;

/* compiled from: DataCollectionArbiter */
public class l0 {
    public final SharedPreferences a;
    public final c b;
    public final Object c = new Object();
    public h<Void> d = new h();
    public boolean e = false;
    public Boolean f;
    public h<Void> g = new h();

    /* JADX WARNING: Removed duplicated region for block: B:23:0x0081  */
    /* JADX WARNING: Removed duplicated region for block: B:22:0x007d  */
    public l0(c.e.b.c r7) {
        /*
        r6 = this;
        r6.<init>();
        r0 = new java.lang.Object;
        r0.<init>();
        r6.c = r0;
        r0 = new c.e.a.b.g.h;
        r0.m1534init();
        r6.d = r0;
        r0 = 0;
        r6.e = r0;
        r1 = new c.e.a.b.g.h;
        r1.m1534init();
        r6.g = r1;
        r7.a();
        r1 = r7.a;
        r6.b = r7;
        r7 = c.e.b.h.e.k.g.n(r1);
        r6.a = r7;
        r2 = "firebase_crashlytics_collection_enabled";
        r3 = r7.contains(r2);
        r4 = 1;
        r5 = 0;
        if (r3 == 0) goto L_0x003d;
    L_0x0032:
        r6.e = r0;
        r7 = r7.getBoolean(r2, r4);
        r7 = java.lang.Boolean.valueOf(r7);
        goto L_0x003e;
    L_0x003d:
        r7 = r5;
    L_0x003e:
        if (r7 != 0) goto L_0x008d;
    L_0x0040:
        r7 = "firebase_crashlytics_collection_enabled";
        r2 = r1.getPackageManager();	 Catch:{ NameNotFoundException -> 0x0069 }
        if (r2 == 0) goto L_0x007a;
    L_0x0048:
        r1 = r1.getPackageName();	 Catch:{ NameNotFoundException -> 0x0069 }
        r3 = 128; // 0x80 float:1.794E-43 double:6.32E-322;
        r1 = r2.getApplicationInfo(r1, r3);	 Catch:{ NameNotFoundException -> 0x0069 }
        if (r1 == 0) goto L_0x007a;
    L_0x0054:
        r2 = r1.metaData;	 Catch:{ NameNotFoundException -> 0x0069 }
        if (r2 == 0) goto L_0x007a;
    L_0x0058:
        r2 = r2.containsKey(r7);	 Catch:{ NameNotFoundException -> 0x0069 }
        if (r2 == 0) goto L_0x007a;
    L_0x005e:
        r1 = r1.metaData;	 Catch:{ NameNotFoundException -> 0x0069 }
        r7 = r1.getBoolean(r7);	 Catch:{ NameNotFoundException -> 0x0069 }
        r7 = java.lang.Boolean.valueOf(r7);	 Catch:{ NameNotFoundException -> 0x0069 }
        goto L_0x007b;
    L_0x0069:
        r7 = move-exception;
        r1 = c.e.b.h.e.b.a;
        r2 = 3;
        r1 = r1.a(r2);
        if (r1 == 0) goto L_0x007a;
    L_0x0073:
        r1 = "FirebaseCrashlytics";
        r2 = "Unable to get PackageManager. Falling through";
        android.util.Log.d(r1, r2, r7);
    L_0x007a:
        r7 = r5;
    L_0x007b:
        if (r7 != 0) goto L_0x0081;
    L_0x007d:
        r6.e = r0;
        r7 = r5;
        goto L_0x008d;
    L_0x0081:
        r6.e = r4;
        r0 = java.lang.Boolean.TRUE;
        r7 = r0.equals(r7);
        r7 = java.lang.Boolean.valueOf(r7);
    L_0x008d:
        r6.f = r7;
        r7 = r6.c;
        monitor-enter(r7);
        r0 = r6.a();	 Catch:{ all -> 0x009f }
        if (r0 == 0) goto L_0x009d;
    L_0x0098:
        r0 = r6.d;	 Catch:{ all -> 0x009f }
        r0.b(r5);	 Catch:{ all -> 0x009f }
    L_0x009d:
        monitor-exit(r7);	 Catch:{ all -> 0x009f }
        return;
    L_0x009f:
        r0 = move-exception;
        monitor-exit(r7);	 Catch:{ all -> 0x009f }
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.b.h.e.k.l0.m1727init(c.e.b.c):void");
    }

    public synchronized boolean a() {
        boolean booleanValue;
        Boolean bool = this.f;
        if (bool != null) {
            booleanValue = bool.booleanValue();
        } else {
            booleanValue = this.b.f();
        }
        String str = booleanValue ? "ENABLED" : "DISABLED";
        String str2 = this.f == null ? "global Firebase setting" : this.e ? "firebase_crashlytics_collection_enabled manifest flag" : "API";
        b.a.b(String.format("Crashlytics automatic data collection %s by %s.", new Object[]{str, str2}));
        return booleanValue;
    }

    public g<Void> b() {
        a0 a0Var;
        a0 a0Var2 = this.g.a;
        synchronized (this.c) {
            a0Var = this.d.a;
        }
        FilenameFilter filenameFilter = a1.a;
        h hVar = new h();
        b1 b1Var = new b1(hVar);
        a0Var2.d(b1Var);
        a0Var.d(b1Var);
        return hVar.a;
    }
}
